#!/bin/bash

echo "🚀 启动A2A多智能体协商可视化系统"
echo "=================================="

# 检查服务状态
echo "📊 检查服务状态..."
echo "  🔍 MCP服务器 (端口7001): $(lsof -i :7001 >/dev/null && echo '✅ 运行中' || echo '❌ 未运行')"
echo "  🤖 WeatherAgent (端口7003): $(lsof -i :7003 >/dev/null && echo '✅ 运行中' || echo '❌ 未运行')"
echo "  🌐 Web后端 (端口8000): $(lsof -i :8000 >/dev/null && echo '✅ 运行中' || echo '❌ 未运行')"
echo "  📄 前端服务 (端口8080): $(lsof -i :8080 >/dev/null && echo '✅ 运行中' || echo '❌ 未运行')"

echo ""
echo "🎯 访问地址:"
echo "  📱 可视化界面: http://localhost:8080"
echo "  📖 API文档: http://localhost:8000/docs"
echo "  🔍 健康检查: http://localhost:8000/health"

echo ""
echo "💡 使用说明:"
echo "  1. 在浏览器中打开 http://localhost:8080"
echo "  2. 在左侧输入您的旅行需求"
echo "  3. 点击'开始AI团队协商'按钮"
echo "  4. 实时观看Agent间的协商过程"
echo "  5. 查看详细的决策过程和最终结果"

echo ""
echo "🔧 管理命令:"
echo "  📋 查看协商日志: ./view_logs.sh"
echo "  🧠 分析决策过程: ./analyze_decisions.sh"
echo "  🛑 停止所有服务: fuser -k 7001/tcp 7003/tcp 8000/tcp 8080/tcp"

echo ""
echo "✨ 享受A2A多智能体协商的魅力！"
